<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>设备风险标记记录表 管理</title>
	<jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="rskPrdSignLog_form">
	<div class="fieldset1 tabel_col tabel_col_1 clearFix">
		<div class="fieldBox col_33">
			<div class="label">VIN(车架号)</div>
			<div class="field">
				<input name="vin" id="vin" type="text" class="ui-textbox" value="${rskPrdSignLogVO.vin}" readonly="true" validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">支付表</div>
			<div class="field">
				<input name="paySchNo" id="paySchNo" type="text" class="ui-textbox" value="${rskPrdSignLogVO.paySchNo}" readonly="true" validate="{required:false,maxlength:21}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">支付表状态</div>
			<div class="field">
				<input name="prdStsCd" id="prdStsCd" type="text" class="ui-textbox" value="${rskPrdSignLogVO.prdStsCd}" readonly="true" validate="{required:false}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">起租日</div>
			<div class="field">
				<input name="lsDt" id="lsDt" type="text" class="ui-textbox" value="${rskPrdSignLogVO.lsDt}" readonly="true" validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">项目类型</div>
			<div class="field">
				<input name="prjTypCd" id="prjTypCd" type="text" class="ui-textbox" value="${rskPrdSignLogVO.prjTypCd}" readonly="true" validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">事业部</div>
			<div class="field">
				<input name="buOrgCd" id="buOrgCd" type="text" class="ui-textbox" value="${rskPrdSignLogVO.buOrgCd}" readonly="true" validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">标记类型</div>
			<div class="field">
				<input name="signResType" id="signResType" placeholder="请选择" ltype="combobox" validate="{required:true}">
				<span class="requiredSymbol">*</span>
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">标记原因</div>
			<div class="field">
				<input name="signResCd" id="signResCd" placeholder="请选择" ltype="combobox" validate="{required:true}">
				<span class="requiredSymbol">*</span>
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">标记时间</div>
			<div class="field">
				<input name="crtTMNM" id="crtTMNM" type="text" class="ui-textbox" value="${rskPrdSignLogVO.crtTMNM}" readonly="true" validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">原始标记人</div>
			<div class="field">
				<input name="crtUsrNm" id="crtUsrNm" type="text" class="ui-textbox" value="${rskPrdSignLogVO.crtUsrNm}" readonly="true" validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">更新时间</div>
			<div class="field">
				<input name="mdfTMNM" id="mdfTMNM" type="text" class="ui-textbox" value="${rskPrdSignLogVO.mdfTMNM}" readonly="true" validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_33">
			<div class="label">更新标记人</div>
			<div class="field">
				<input name="mdfUsrNm" id="mdfUsrNm" type="text" class="ui-textbox" value="${rskPrdSignLogVO.mdfUsrNm}" readonly="true"  validate="{required:false,maxlength:64}">
			</div>
		</div>
		<div class="fieldBox col_100">
			<div class="label">备注</div>
			<div class="field">
				<textarea name="signRem" id="signRem" class="ui-textarea l-textarea" value="" cols="120" rows="4">${rskPrdSignLogVO.signRem}</textarea>
			</div>
		</div>
	</div>
	<div class="btnsBox">
		<span id="saveRskPrdSignLog_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
		<span id="closeBtn" class="sq-button sq-button-round co_normal">关闭</span>
		<input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
	</div>
</form>
<script>
    $(function() {
        var rskPrdSignLogId = "${rskPrdSignLogVO.id}";//主键ID

        $("#signResCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
		$("#signResType").ligerComboBox({
			valueField: 'key',
			textField: 'value'
		});
        $("#rskPrdSignLog_form").ligerForm({
            validate: true
        });
        liger.get("signResCd").setData(${signResCdList});
		liger.get("signResType").setData(${signResTypeList});
		var signResType = "${rskPrdSignLogVO.signResType}";
		var signResTypeNm = "${rskPrdSignLogVO.signResTypeNm}";
		var signRes = "${rskPrdSignLogVO.signResCd}";
		var signResCdNam = "${rskPrdSignLogVO.signResCdNam}";
		$("#signResType").val(signResTypeNm);
		$("#signResType").selected = true;
		$("#signResCd").val(signResCdNam);
		$("#signResCd").selected = true;
		if(signResType == 3){//黑名单
			liger.get('signResType').setDisabled();
			liger.get('signResCd').setDisabled();
		}


        /*保存*/
        $("#saveRskPrdSignLog_Btn").click(function (event) {
            var form = liger.get("rskPrdSignLog_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
			if (data.signResCd == null || data.signResCd == '') {
				data["signResCd"] = signRes;
			}
			if (data.signResType == null || data.signResType == '') {
				data["signResType"] = signResType;
			}
            $.ligerDialog.hide();
            var _url = '<%=path%>/risk/rskPrdSignLog/modify.do?id='+rskPrdSignLogId;
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
						if($("#signResType").val() == '黑名单'){
							liger.get('signResType').setDisabled();
							liger.get('signResCd').setDisabled();
						}
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();

                        //$("#resetBtn").click();
                        //回调刷新列表
                        //var callback=frameElement.W2W.callback;
                        //Remove_navTab();
                        //callback();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });

        /*关闭*/
        $("#closeBtn").click(function (event) {
            frameElement.dialog.close();
        });
    });

</script>
</body>
</html>
